<template>
  <span>{{ department }}</span>
</template>
<script>
import { getDepartment } from '@/api/department'

export default {
  data() {
    return { department: null }
  },
  beforeMount() {
    getDepartment(this.params.value)
      .then(response => {
        if (response.Result === 0) {
          this.department = response.Data.Name
        }
      })
      .catch(error => {
        console.log(error)
        this.department = '未知错误'
      })
  }
}
</script>
